	// swift-tools-version:5.10
import PackageDescription

let package = Package(
	name: "hello",
	platforms: [
		.macOS(.v13)
	],
	dependencies: [
		// 💧 A server-side Swift web framework.
		.package(url: "https://github.com/vapor/vapor.git", from: "4.99.3"),
		// 🗄 An ORM for SQL and NoSQL databases.
		.package(url: "https://github.com/vapor/fluent.git", from: "4.9.0"),
		// 🐬 Fluent driver for MySQL.
		.package(url: "https://github.com/vapor/fluent-mysql-driver.git", from: "4.4.0"),
		// 🔵 Non-blocking, event-driven networking for Swift.
		.package(url: "https://github.com/apple/swift-nio.git", from: "2.65.0"),
		// 日志信息配置文件
		.package(url: "https://github.com/SwiftyBeaver/SwiftyBeaver.git", .upToNextMajor(from: "2.1.1")),
		.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
		.package(url: "https://github.com/vapor/redis.git", from: "4.0.0"),
		.package(url: "https://github.com/vapor/queues-redis-driver.git", from: "1.0.0"),
		.package(url: "https://github.com/vapor/apns.git", from: "4.0.0"),
		// JWT处理库，用于验证Apple令牌
		.package(url: "https://github.com/vapor/jwt-kit.git", from: "4.0.0"),
		
		// 阿里云短信SDK
		.package(url: "https://github.com/alibabacloud-sdk-swift/dysmsapi-20170525.git", from: "3.1.0"),
		// 阿里云邮件推送SDK
		.package(url: "https://github.com/alibabacloud-sdk-swift/dm-20151123.git", from: "1.2.4"),
	],
	
	targets: [
		// 添加 zlib 系统库目标
		.systemLibrary(
			name: "Czlib",
			pkgConfig: "zlib",
			providers: [
				.apt(["zlib1g-dev"]),
				.brew(["zlib"])
			]
		),
		.executableTarget(
			name: "App",
			dependencies: [
				.product(name: "Fluent", package: "fluent"),
				.product(name: "FluentMySQLDriver", package: "fluent-mysql-driver"),
				.product(name: "Vapor", package: "vapor"),
				.product(name: "NIOCore", package: "swift-nio"),
				.product(name: "NIOPosix", package: "swift-nio"),
				.product(name: "SwiftyBeaver", package: "SwiftyBeaver"),
				.product(name: "Redis", package: "redis"),
				.product(name: "QueuesRedisDriver", package: "queues-redis-driver"),
				.product(name: "VaporAPNS", package: "apns"),
				.product(name: "JWTKit", package: "jwt-kit"),
				
				// 添加阿里云SDK产品依赖
				.product(name: "AlibabacloudDysmsapi20170525", package: "dysmsapi-20170525"),
				.product(name: "AlibabacloudDm20151123", package: "dm-20151123"),
				"Czlib"  // 添加 Czlib 依赖
			],
			swiftSettings: swiftSettings,
			linkerSettings: [
				.linkedLibrary("z")  // 添加 zlib 链接设置
			]
		),
		.testTarget(
			name: "AppTests",
			dependencies: [
				.target(name: "App"),
				.product(name: "XCTVapor", package: "vapor"),
			],
			swiftSettings: swiftSettings
		)
	]
)

var swiftSettings: [SwiftSetting] { [
	.enableUpcomingFeature("DisableOutwardActorInference"),
	.enableExperimentalFeature("StrictConcurrency"),
	] }
